/**
 * 关于不同图层标记的类型 属性 map， 及颜色配色方案
 */

/**
 * 标记类型 icon
 */
export const tabTypeIconMap: any = {
  color: 'iconyanse', // 颜色标记 icon
  size: 'icondaxiao', // 大小标记 icon
  label: 'iconwenzi', // 标签标记 icon
  detail: 'iconxiangxixinxi', // 详情标记 icon
}

// 不同图层类型对应修改颜色的属性
export const paintPropertyNameMap: { [layerType: string]: string } = {
  circle: 'circle-color',
  line: 'line-color',
  fill: 'fill-color',
}

export const paintPropertyOpacityNameMap: { [layerType: string]: string } = {
  circle: 'circle-opacity',
  line: 'line-opacity',
  fill: 'fill-opacity',
}

/**
 * 默认标签标记的配置
 */
export const defaultLabelTagLayerStyle: { [key: string]: any } = {
  paint: {
    'text-color': '#404040',
    'text-opacity': 1,
  },
  layout: {
    'text-size': 10,
    'text-anchor': 'top',
    'text-offset': [0, 0.2],
  },
}

/**
 * 离散型字段配色方案
 */
export const colorGroupOptions: { [key: string]: any } = {
  themeColor1: {
    id: 'themeColor1',
    text: '默认',
    type: 'qualitative',
    value: [
      '#7A88F2',
      '#FBC94B',
      '#65DCB8',
      '#EF7C52',
      '#F595C6',
      '#6E80A2',
      '#5DC6D7',
      '#FFA65E',
      '#ABABAB',
      '#CC69D9',
      '#16A37E',
      '#7751FF',
    ],
  },
  themeColor2: {
    id: 'themeColor2',
    text: '清新',
    type: 'qualitative',
    value: [
      '#8DD3C7',
      '#FFFFB3',
      '#BEBADA',
      '#FB8072',
      '#80B1D3',
      '#FDB462',
      '#B3DE69',
      '#FCCDE5',
      '#D9D9D9',
      '#BC80BD',
      '#CCEBC5',
      '#FFED6F',
    ],
    opacity: 0.6,
  },
  themeColor3: {
    id: 'themeColor3',
    text: '经典',
    type: 'qualitative',
    value: [
      '#A6CEE3',
      '#1F78B4',
      '#B2DF8A',
      '#33A02C',
      '#FB9A99',
      '#E31A1C',
      '#FDBF6F',
      '#FF7F00',
      '#CAB2D6',
      '#6A3D9A',
      '#6A3D9A',
      '#B15928',
    ],
    opacity: 0.3,
  },
  themeColor4: {
    id: 'themeColor4',
    text: '闪耀',
    type: 'qualitative',
    value: [
      '#C22E34',
      '#E5B600',
      '#0298D8',
      '#2C811D',
      '#025DAB',
      '#339CA8',
      '#E87C25',
      '#9BCA63',
      '#60C0DD',
      '#BC80BD',
      '#908D8D',
      '#26C0C0',
    ],
  },
  themeColor5: {
    id: 'themeColor5',
    text: '柔和',
    type: 'qualitative',
    value: [
      '#A4ABFB',
      '#F9D26F',
      '#AED495',
      '#F5A4AC',
      '#DDB6FF',
      '#6E80A2',
      '#A2DCED',
      '#FF9465',
      '#ABABAB',
    ],
  },
  themeColor6: {
    id: 'themeColor6',
    text: '复古1',
    type: 'qualitative',
    value: [
      '#D87C7C',
      '#919E8B',
      '#D7AB82',
      '#6E7074',
      '#61A0A8',
      '#EFA18D',
      '#787464',
      '#CC7E63',
      '#724E58',
    ],
  },
  themeColor7: {
    id: 'themeColor7',
    text: '复古2',
    type: 'qualitative',
    value: [
      '#E02354',
      '#001853',
      '#F6E8C8',
      '#B8D2C7',
      '#C7B38E',
      '#A4D7C2',
      '#F3D99A',
      '#D2758F',
      '#DDC292',
    ],
  },
  themeColor8: {
    id: 'themeColor8',
    text: '艳丽',
    type: 'qualitative',
    value: [
      '#E41A1C',
      '#377EB8',
      '#4DAF4A',
      '#984EA3',
      '#FF7F00',
      '#FFFF33',
      '#A65628',
      '#F781BF',
      '#999999',
    ],
  },
  themeColor9: {
    id: 'themeColor9',
    text: '淡雅',
    type: 'sequential',
    value: [
      '#2EC6C8',
      '#B6A2DE',
      '#59B1EF',
      '#FFB981',
      '#D87A80',
      '#8D98B3',
      '#E5CF0F',
      '#97B551',
      '#956F6D',
    ],
  },
  themeColor10: {
    id: 'themeColor10',
    text: '信息图',
    type: 'sequential',
    value: [
      '#C1232B',
      '#27727A',
      '#FBCE12',
      '#E97C25',
      '#B4C334',
      '#FE8463',
      '#9ACA63',
      '#FAD860',
      '#F3A53B',
    ],
  },
}

/**
 * 连续型字段配色方案
 */
export const successiveColors: any[] = [
  ['#802603', '#E5E8FF', '#16227E'],
  ['#082F6B', '#F7FBFF', '#802603'],
  ['#67090E', '#F7FCF5', '#00441B'],
  ['#3F157D', '#FCFBFD', '#802603'],
  ['#000000', '#FCFBFD', '#67090E'],
  ['#F7FBFF', '#082F6B'],
  ['#F7FCF5', '#00441B'],
  ['#FEF5EB', '#802603'],
  ['#FCFBFD', '#3F157D'],
  ['#FEF5F1', '#67090E'],
  ['#FFFFFF', '#000000'],
  ['#FFFFE5', '#004529'],
  ['#F7FCF0', '#084081'],
  ['#FFF7FB', '#014636'],
  ['#FFFFD9', '#081D58'],
  ['#FFFFCC', '#800026'],
  ['#FFF7F3', '#49006A'],
]

/**
 * 边框颜色
 */
export const borderColor: any = [
  '#A4ABFB',
  '#F5A4AC',
  '#A2DCED',
  '#F9D26F',
  '#8FB2FA',
  '#AED495',
  '#6E80A2',

  '#DDB6FF',
  '#FDB69E',
  '#BFE8EF',
  '#FFE4A8',
  '#BDD3FB',
  '#C2EDAD',
  '#9CA7B9',

  '#7751FF',
  '#F3470D',
  '#5AB7DA',
  '#FBC94B',
  '#3464FF',
  '#16A37E',
  '#4F5F7D',

  '#ECECEC',
  '#D2D2D2',
  '#ABABAB',
  '#818181',
  '#5B5B5B',
  '#404040',
  '#000000',
]
